home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / longfile / readme.txt < prev   
Encoding:
Text File  |  1996-08-12  |  4.8 KB  |  114 lines

  1. readme.txt for longfile.zip
  2.  
  3. =====================================================================
  4. The files in this zip are intended to be added to a Visual Basic 3.0
  5. or 16-bit Visual Basic 4.0 project.  Using the enclosed modules will
  6. allow 16-bit Visual Basic applications to use long file names in user
  7. display while retaining short filenames for internal use.  
  8.  
  9. =====================================================================
  10. All files are copyright 1996, Internet Software Engineering.  The author
  11. is requesting a one-time user fee of $10.  Contact ise@arctic-ise.com 
  12. for more info.  
  13.  
  14. =====================================================================
  15. What's included:
  16. longfile.frm
  17. longfile.bas
  18.  
  19. Sample application also uses:
  20. longfile.mak
  21. fileopen.bas
  22. Form1.frm
  23.  
  24. =====================================================================
  25. What the files are about:
  26. longfile.frm is a VB rendition of a common dialog box.  I considered
  27. making this a .dll, but the resulting file was over 50K, where the VB
  28. equivalent takes around 15K.  In the interest of compactness, I went
  29. with the VB option.  Of course, this leaves the source code wide open
  30. to plagarism -- the dishonest won't care, the guilty may send some
  31. bucks to alleviate your sins... anyway, longfile.frm does the majority
  32. of the processing necessary to get and convert long filenames from
  33. the operating system.  More details are below.
  34.  
  35. longfile.bas contains declares and the main entry point into the 
  36. longfile routines.
  37.  
  38. longfile.mak is a VB3 makefile for a sample application.
  39.  
  40. fileopen.bas is a module containing file open and save routines for
  41. the sample application.
  42.  
  43. Form1.frm is a simple application form, allowing the user to open and
  44. save a text file.
  45.  
  46. =====================================================================
  47. FAQ:
  48. 1. (So far, the only asked question!) So if I understand correctly,
  49. if I incorporate these modules into my 16-bit VB application, run 
  50. that application on Windows 3.1, I have access to regular DOS 8.3 
  51. style filenames, then run the same application on Window 95 or NT, 
  52. and I also have access to both long and short filenames.  Is that 
  53. right?
  54.  
  55. YES.
  56.  
  57. =====================================================================
  58. Here's the main comments from the source code, which gives a pretty
  59. good explanation of the modules and their use.  Also check out the
  60. sample application for a more complete example.
  61.  
  62. This form and its accompanying longfile.bas module allow 16-bit VB
  63. applications to use long file names when run in environments (Windows 95
  64. and Windows NT) that support them.  Set up for a call to this form is
  65. much like a call to a common dialog box, but with considerably less
  66. properties.  The properties are stored in the following structure:
  67.  
  68. ' structure for dialog box setup
  69. Type LongFile
  70.    Action as Integer         ' 1 = Open, 2 = Save
  71.    Color As Long             ' background color
  72.    DialogTitle As String     ' title bar text
  73.    Filename As String        ' filename for input to dialog box, output filename will be in gShortFilename and gLongFilename
  74.    Filter As String          ' file extension filter
  75.    FilterIndex As Integer    ' index into file extension filter
  76. End Type
  77.  
  78. This structure is declared as LF and the declaration is global.  Note
  79. one major difference between this structure and that of the common dialog
  80. box:  the Filename string is used only to send a name to this form.  The
  81. string will be null upon exit from this form.  The user selected filename
  82. will be in two global variables, gShortFilename and gLongFilename.  Both
  83. will contain the full path to the filename.  Another global variable,
  84. gIn16BitSystem will be set to True if the system only supports short
  85. filenames, False if the system supports long filenames.  In 16-bit Windows 
  86. systems, both gShortFilename and gLongFilename will contain the same value.
  87.  
  88. Sample setup and call:
  89.      LF.Action = 1     ' nothing happens until call to GetLongFilename
  90.      LF.DialogTitle = "Select File to Open"
  91.      LF.Filter = "Text (*.txt)|*.txt|HTML (*.htm)|*.htm|All Files (*.*)|*.*"
  92.      LF.FilterIndex = 2   ' set html as default file type
  93.      GetLongFilename
  94.  
  95. Another example:
  96.      LF.Action = 2     ' nothing happens until call to GetLongFilename
  97.      LF.DialogTitle = "Save File"
  98.      LF.Filename = "foo.txt"
  99.      GetLongFilename
  100.      if LF.Action = -1 ' then user chose Cancel
  101.  
  102. Since the LF structure is global, structure values remain intact between
  103. calls except for LF.Filename, which is cleared after each call to
  104. GetLongFilename, and LF.Action, which is set to zero on normal exit or
  105. -1 if the user selected the Cancel button.
  106.  
  107. =======
  108. Internet Software Engineering
  109. ise@arctic-ise.com
  110. http://www.arctic-ise.com/ise
  111. 1120 22nd Avenue
  112. Clarkston, WA 99403 USA
  113. (509) 758-3706
  114.